import request from '@/utils/request'
import { downFile } from '@/utils/request'

/**
 * 工厂信息分页查询
 * @param {查询条件} data
 */
export function pageFacFactory(query) {
  return request({
    url: 'FacManage/FacFactory/pageList',
    method: 'get',
    params: query,
  })
}

/**
 * 工厂信息查询
 * @param {查询条件} data
 */
export function listFacFactory(query) {
  return request({
    url: 'FacManage/FacFactory/list',
    method: 'get',
    params: query,
  })
}

/**
 * 新增工厂信息
 * @param data
 */
export function addFacFactory(data) {
  return request({
    url: 'FacManage/FacFactory',
    method: 'post',
    data: data,
  })
}
/**
 * 修改工厂信息
 * @param data
 */
export function updateFacFactory(data) {
  return request({
    url: 'FacManage/FacFactory',
    method: 'PUT',
    data: data,
  })
}
/**
 * 获取工厂信息详情
 * @param {Id}
 */
export function getFacFactory(id) {
  return request({
    url: 'FacManage/FacFactory/' + id,
    method: 'get'
  })
}

/**
 * 删除工厂信息
 * @param {主键} 
 */
export function delFacFactory(pid) {
  return request({
    url: 'FacManage/FacFactory/delete',
    method: 'POST',
    data: pid
  })
}
// 导出工厂信息
export async function exportFacFactory(query) {
  await downFile('FacManage/FacFactory/export', { ...query })
}
